package com.demo.morning;

/**
 * @ClassName 课堂小练习3
 * @Description TODO
 * @Author tianqinglong
 * @Date 10:52 2022/7/5
 * @Version 1.0
 **/
public class 课堂小练习3 {
    public static void main(String[] args) {
        Car car = new Car(100,"法拉利");
        car.show();
    }
}
class Car{
    private int price ;
    private String name;

    public Car() {
    }

    public Car(int price, String name) {
        this.price = price;
        this.name = name;
    }

    void show(){
        System.out.println(price+"-"+name);
    }
}
class Student{
    private String name;

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                '}';
    }
}